Ext.define('carManage.view.refuelInfo.GridList', {
    extend: 'Ext.grid.Panel',
    store: 'RefuelInfoStore',
    alias: 'widget.gridList',
    selModel: Ext.create('Ext.selection.CheckboxModel', {mode: "SIMPLE"}),
    initComponent: function() {
        this.columns = [
            {
                header: '编号',
                sortable: true,
                hidden: true,
                dataIndex: 'id'
            }, {
                header: '车牌号码',
                sortable: true,
                width: 92,
                dataIndex: 'car_code'
            }, {
                header: '加油类型',
                sortable: true,
                width: 82,
                dataIndex: 'type',
                renderer: function(v) {
                    if (v == '1') {
                        return '现金加油'
                    } else if (v == '2') {
                        return '油卡加油'
                    } else if (v == '3') {
                        return '其他加油方式'
                    }
                }
            }, {
                header: '加油金额',
                sortable: true,
                width: 74,
                dataIndex: 'money',
                renderer: function(v) {
                    return v + "元";
                }
            }, {
                header: '加油数量',
                sortable: true,
                width: 67,
                dataIndex: 'quantity',
                renderer: function(v) {
                    return v ;
                }
            }, {
                header: '加油时间',
                sortable: true,
                width: 84,
                dataIndex: 'ref_date'
            }, {
                header: '驾驶员',
                sortable: true,
                width: 61,
                dataIndex: 'driver'
            }, {
                header: '油卡编号',
                sortable: true,
                width: 100,
                dataIndex: 'card_code'
            }, {
                header: '油料单价',
                sortable: true,
                width: 65,
                dataIndex: 'ref_price',
                renderer: function(v) {
                    return v + "元";
                }
            }, {
                header: '加油地点',
                sortable: true,
                width: 92,
                dataIndex: 'ref_area'
            }, {
                header: '路码数',
                sortable: true,
                width: 71,
                dataIndex: 'yard'
            }, {
                header: '备注',
                sortable: true,
                width: 200,
                dataIndex: 'remark'
            }
        ];

        this.bbar = new Ext.PagingToolbar({
            store: 'RefuelInfoStore',
            emptyMsg: '没有数据需要显示',
            displayInfo: true
        });
        this.callParent(arguments);
    }
});